package com.yequan.json;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * @author : Administrator
 * @date : 2020/10/2
 */
public class JsonDemo {

    public static void main(String[] args) {
        String jsonStr = "{name:'hh',age:12,addr:'beijing'}";
        JSONObject jsonObject = JSON.parseObject(jsonStr);
        Set<Map.Entry<String, Object>> entries = jsonObject.entrySet();
        Iterator<Map.Entry<String, Object>> iterator = entries.iterator();
        while (iterator.hasNext()) {
            Map.Entry<String, Object> next = iterator.next();
            System.out.println(next.getKey() + " : " + next.getValue());
        }
    }

}
